package com.zxl.permission.demo;

import java.sql.Timestamp;

import java.util.concurrent.TimeUnit;

public class demo_timestamp {
    public static void main(String[] args) throws InterruptedException {
        Timestamp t1 = new Timestamp(System.currentTimeMillis());
        System.out.println(t1);

        TimeUnit.SECONDS.sleep(1);
        Timestamp t2 = new Timestamp(System.currentTimeMillis());

        System.out.println(t2);
        System.out.println(t2.getTime() );


        TimeUnit.SECONDS.sleep(3);
        Timestamp t3 = new Timestamp(System.currentTimeMillis());

        System.out.println(t3);
        System.out.println(t3.getTime() - t2.getTime());
    }

}
